import { PrismaClient } from "@prisma/client";
import { hash } from "argon2";
import { Random } from "mockjs";
const prisma = new PrismaClient();
async function run (){
 await  prisma.user.create({
    data: {
      name: "admin",
      password:await hash('admin123'),
      password_confirm: await hash('admin123'),
    },
  });
  for(let i=0;i<10;i++){
    await prisma.category.create({
      data:{
        name:Random.ctitle(2,6),

      }
    })
  }
 for(let i=0;i<50;i++){
  await prisma.article.create({
    data: {
      title: Random.ctitle(5,10),
      content: Random.cparagraph(30,100),
      category_id: Random.integer(1,8),
    },
  });
 }
}
run()